package com.cms.recursoshumanos.facade;

import com.cms.recursoshumanos.constant.Constant;
import com.cms.recursoshumanos.handler.WServiceCall;
import com.cms.recursoshumanos.json.me.JSONParser;
import com.cms.recursoshumanos.json.object.JsonObjectGetPlanillaCartaAval;

public class PlanillaCartaAvalActivityFacade 
{

	private String strUsername, strPass,
					strNombreOperation,strMonto;
	
	private int	intIdFamiliar,intIdHospital,
					strIdPoliza;

	
	public PlanillaCartaAvalActivityFacade(String user,
											String password,
											int id_poliza,
											int id_familiar,
											int id_hospital,
											String nombre_operation,
											String monto)
	{
		this.strUsername = user;
		this.strPass = password;
		this.strIdPoliza = id_poliza;
		this.intIdFamiliar = id_familiar;
		this.intIdHospital = id_hospital;
		this.strNombreOperation = nombre_operation;
		this.strMonto = monto;
		
	}
	

	
	public String enviarSolicitud()
	{
		 
		JSONParser jParser = new JSONParser();
		return jParser.
						setPetitionToUrl(
								Constant.URL_WEBSERVICE, 
								WServiceCall.getInstance().getPlanillaCartaAval(strUsername, 
																					strPass, 
																					strIdPoliza, 
																					intIdFamiliar, 
																					intIdHospital, 
																					strNombreOperation, 
																					strMonto));

	}
	public String enviarSolicitud1()
	{
		 
		JSONParser jParser = new JSONParser();
		return setValores(jParser.
						getJSONFromUrl(
								Constant.URL_WEBSERVICE, 
								WServiceCall.getInstance().getPlanillaCartaAval(strUsername, 
																					strPass, 
																					strIdPoliza, 
																					intIdFamiliar, 
																					intIdHospital, 
																					strNombreOperation, 
																					strMonto)));

	}
	
	public String setValores(String strResult)
	{

		JsonObjectGetPlanillaCartaAval.getInstance().fromJSON(strResult);
		return JsonObjectGetPlanillaCartaAval.getInstance().getResultProceso();
		
		
	}
	

	
}

